﻿@using Zavand.Web.Mvc.Manana.SampleWebsite.Common.ExternalRoutes
@model Zavand.Web.Mvc.Manana.SampleWebsite.Controllers.My.Actions.Index.Model
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<fieldset>
<legend>MVC</legend>
Area = @Model.GetRoute().Area <br/>
Controller = @Model.GetRoute().Controller <br/>
Action = @Model.GetRoute().Action <br/>
</fieldset>
<fieldset>
<legend>Route</legend>
Locale = @Model.GetRoute().Locale <br/>
Page = @Model.GetRoute().Page <br/>
PageSize = @Model.GetRoute().PageSize <br/>
</fieldset>
<fieldset>
<legend>Model</legend>
Locale = @Model.Locale <br/>
Page = @Model.Page <br/>
PageSize = @Model.PageSize <br/>
</fieldset>

<div>
@(Html.ActionLinkClone("en-US", Model.GetRoute(), m => { m.Locale = "en-US"; })) | 
@(Html.ActionLinkClone("ru-RU", Model.GetRoute(), m => { m.Locale = "ru-RU"; }))
</div>
<div>
@(Html.ActionLinkClone("Page 1", Model.GetRoute(), m => { m.Page=1; })) |
@(Html.ActionLinkClone("Page 2", Model.GetRoute(), m => { m.Page=2; })) |
@(Html.ActionLinkClone("Page 3", Model.GetRoute(), m => { m.Page=3; }))
</div>
<div>
@(Html.ActionLinkClone("100", Model.GetRoute(), m => { m.PageSize=100; })) |
@(Html.ActionLinkClone("250", Model.GetRoute(), m => { m.PageSize=250; })) |
@(Html.ActionLinkClone("500", Model.GetRoute(), m => { m.PageSize=500; }))
</div>

<div>
    @Html.ActionLink( "Another page", Model.GetRoute(), new Zavand.Web.Mvc.Manana.SampleWebsite.Controllers.My.Actions.Post.Route())
</div>
<hr />
<div>@(Url.RouteUrlClone(Model.GetRoute(), m => { m.Locale = "en-US"; }))</div>
<div>@(Url.RouteUrlClone(Model.GetRoute(), m => { m.Locale = "ru-RU"; }))</div>
<hr />
<div>@(Url.RouteUrlClone(Model.GetRoute(), m => { m.Page=1; }))</div>
<div>@(Url.RouteUrlClone(Model.GetRoute(), m => { m.Page=2; }))</div>
<div>@(Url.RouteUrlClone(Model.GetRoute(), m => { m.Page=3; }))</div>
<hr />
<div>@(Url.RouteUrlClone(Model.GetRoute(), m => { m.PageSize=100; }))</div>
<div>@(Url.RouteUrlClone(Model.GetRoute(), m => { m.PageSize=250; }))</div>
<div>@(Url.RouteUrlClone(Model.GetRoute(), m => { m.PageSize=500; }))</div>
<hr />
<div>@Url.RouteUrl( Model.GetRoute(), new Zavand.Web.Mvc.Manana.SampleWebsite.Controllers.IndexRoute())</div>

<hr />
<fieldset>
<legend>Url &amp; link to area</legend>
    @Url.RouteUrl(Model.GetRoute(), new Zavand.Web.Mvc.Manana.SampleWebsite.Areas.Area1.Controllers.Default.Actions.Index.Route())<br/>
    @Html.ActionLink("Link to area", Model.GetRoute(), new Zavand.Web.Mvc.Manana.SampleWebsite.Areas.Area1.Controllers.Default.Actions.Index.Route())
</fieldset>
<div>
<fieldset>
<legend>Custom route to Post</legend>
@(Url.RouteUrl(Model.GetRoute(), new Zavand.Web.Mvc.Manana.SampleWebsite.Controllers.My.Actions.Post.CustomRoute())) <br/>
@Html.ActionLink("Link to custom route", Model.GetRoute(), new Zavand.Web.Mvc.Manana.SampleWebsite.Controllers.My.Actions.Post.CustomRoute()) <br/>
</fieldset>
<fieldset>
<legend>External domain</legend>
@(Url.RouteUrl(Model.GetRoute(), new CustomExternalRoute())) <br/>
@Html.ActionLink("Link to custom route", Model.GetRoute(), new CustomExternalRoute()) <br/>
</fieldset>
<fieldset>
<legend>External domain. Not default port</legend>
@(Url.RouteUrl(Model.GetRoute(), new CustomExternalDifferentPortRoute())) <br/>
@Html.ActionLink("Link to custom route", Model.GetRoute(), new CustomExternalDifferentPortRoute()) <br/>
</fieldset>
<fieldset>
<legend>Google search</legend>
@(Url.RouteUrl(Model.GetRoute(), new GoogleSearchRoute {SearchText="manana"})) <br/>
@Html.ActionLink("Link to custom route", Model.GetRoute(), new GoogleSearchRoute { SearchText = "manana" }) <br/>
</fieldset>

</div>